Skip to main content
PUT
Replace billing plan

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json

Replace plan payload

name
string
required

Human-readable resource name.

Required string length: 1 - 120
Example:

"Support agent plan"

credit_product_id
string | null

ID of the credit product every customer on the plan draws from. Credits plans only; null leaves each customer's policy to name its own. On replacement, omission preserves the current product and null clears it. Rejected while a customer on the plan draws from another product.

Minimum string length: 1
Example:

"prd_credits"

rate_card_id
string | null

ID of the attached rate card. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.

Minimum string length: 1
Example:

"airc_example"

agents
object[]

Agents the plan lists, each with its own rate card or null for the plan's. Listing an agent does two things: it prices that agent's records with its card first (falling through to the plan's card row by row), and it routes that agent to this plan for every customer on it, ahead of an all-agents plan. So an agent listed only to give it a price on a plan with all_agents_enabled still counts as listed: attaching a customer who has another plan listing the same agent is rejected (plan_agent_conflict), and so is listing it here while such a customer is attached (agent_routing_conflict). At most one entry per agent. On replacement, omission keeps the current list and an empty list clears it.

Maximum array length: 200
Example:
all_agents_enabled
boolean

Whether the plan bills every agent of its customers, besides the agents it lists. When false, only the listed agents are billed through it, and an agent no plan of the customer covers is recorded and not billed. Defaults to true on creation; on replacement, omission keeps the current value. Turning it on, or listing an agent, is rejected while a customer on the plan already gets that agent through another plan.

Example:

true

overage_mode
enum<string> | null

Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.

  • refuse: Rejects the call that crosses the boundary without deducting usage.
  • metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.
  • usage_events: Accepts the call as overage and bills it as usage events (event_type: ai_overage_usage, one per item with its units) priced by your catalog. overage_markup_percent and overage_rate_card_id must be null. Not available in wallet mode.
Available options:
refuse,
metered,
usage_events
Example:

"metered"

markup_percent
string | null

Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.

Maximum string length: 40
Pattern: ^\d+(\.\d+)?$
Example:

"20"

overage_markup_percent
string | null

Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id. Null when overage_mode is usage_events.

Maximum string length: 40
Pattern: ^\d+(\.\d+)?$
Example:

"10"

overage_rate_card_id
string | null

ID of the currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.

Minimum string length: 1
Example:

"airc_overage"

windows
object[]

Rolling allowances. Required for windows plans; each window meters every call. A plan replacement replaces the entire array.

Required array length: 1 - 8 elements
Example:
per_seat_credits
string | null

Credits granted per seat per billing period. Null grants no credits.

Maximum string length: 40
Pattern: ^\d+(\.\d+)?$
Example:

"10000"

grant_rollover_enabled
boolean

Whether granted credits survive renewal. Purchased credits always roll over.

Example:

true

settlement_interval_minutes
integer | null

Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule and settlement_threshold_amount.

Required range: 60 <= x <= 44640
Example:

60

settlement_schedule
enum<string> | null

Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes and settlement_threshold_amount.

  • calendar_month: Settles at the end of each UTC calendar month.
Available options:
calendar_month
Example:

"calendar_month"

settlement_threshold_amount
integer | null

Unsettled balance, in whole minor units, at which usage settles. Null means no amount override. Mutually exclusive with settlement_interval_minutes and settlement_schedule, and refused with overage_mode usage_events, whose overage is sent whatever its amount.

Required range: 1 <= x <= 100000000
Example:

null

Response

id
string
required

Resource ID.

Example:

"d18603dd-7285-4bf5-a45e-88d7de8f37c9"

name
string
required

Human-readable resource name.

Example:

"Support agent plan"

mode
enum<string>
required

Billing mode.

  • wallet: Charges a monetary wallet.
  • credits: Consumes a credit balance.
  • windows: Meters weighted units against rolling allowances.
Available options:
wallet,
credits,
windows
Example:

"wallet"

credit_product_id
string | null
required

ID of the credit product every customer on the plan draws from. Credits plans only; null leaves each customer's policy to name its own. On replacement, omission preserves the current product and null clears it. Rejected while a customer on the plan draws from another product.

Example:

"prd_credits"

rate_card_id
string | null
required

ID of the attached rate card. On policy writes, omission preserves the current reference and null detaches it; on plan replacement omission clears it.

Example:

"airc_example"

agents
object[]
required

Agents the plan lists, each with its own rate card or null for the plan's. Listing an agent does two things: it prices that agent's records with its card first (falling through to the plan's card row by row), and it routes that agent to this plan for every customer on it, ahead of an all-agents plan. So an agent listed only to give it a price on a plan with all_agents_enabled still counts as listed: attaching a customer who has another plan listing the same agent is rejected (plan_agent_conflict), and so is listing it here while such a customer is attached (agent_routing_conflict). At most one entry per agent. On replacement, omission keeps the current list and an empty list clears it.

Example:
all_agents_enabled
boolean
required

Whether the plan bills every agent of its customers, besides the agents it lists. When false, only the listed agents are billed through it, and an agent no plan of the customer covers is recorded and not billed. Defaults to true on creation; on replacement, omission keeps the current value. Turning it on, or listing an agent, is rejected while a customer on the plan already gets that agent through another plan.

Example:

true

windows
object[]
required

Rolling allowances. Required for windows plans; each window meters every call. A plan replacement replaces the entire array.

Example:
markup_percent
string | null
required

Percentage added to resolved cost. Null on writes means no override; an attached plan may supply the value.

Pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
Example:

"20"

overage_mode
enum<string>
required

Behavior when credits or an allowance are exhausted. Policy values may inherit the attached plan.

  • refuse: Rejects the call that crosses the boundary without deducting usage.
  • metered: Prices the whole call as monetary overage, using the overage card or USD provider cost plus markup.
  • usage_events: Accepts the call as overage and bills it as usage events (event_type: ai_overage_usage, one per item with its units) priced by your catalog. overage_markup_percent and overage_rate_card_id must be null. Not available in wallet mode.
Available options:
refuse,
metered,
usage_events
Example:

"metered"

overage_markup_percent
string | null
required

Percentage added to provider cost for overage. Mutually exclusive with overage_rate_card_id. Null when overage_mode is usage_events.

Pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
Example:

"10"

overage_rate_card_id
string | null
required

ID of the currency rate card used to price overage directly. Null means provider cost plus the resolved overage markup.

Example:

"airc_overage"

settlement_interval_minutes
number | null
required

Settlement interval in minutes. Null means no interval override. Mutually exclusive with settlement_schedule and settlement_threshold_amount.

Example:

60

settlement_schedule
enum<string> | null
required

Calendar settlement schedule. Null clears the override; mutually exclusive with settlement_interval_minutes and settlement_threshold_amount.

  • calendar_month: Settles at the end of each UTC calendar month.
Available options:
calendar_month
Example:

"calendar_month"

settlement_threshold_amount
number | null
required

Unsettled balance, in whole minor units, at which usage settles. Null means no amount override. Mutually exclusive with settlement_interval_minutes and settlement_schedule, and refused with overage_mode usage_events, whose overage is sent whatever its amount.

Example:

null

per_seat_credits
string | null
required

Credits granted per seat per billing period. Null grants no credits.

Pattern: ^-?\d+(\.\d+)?(e[+-]?\d+)?$/i
Example:

"10000"

grant_rollover_enabled
boolean
required

Whether granted credits survive renewal. Purchased credits always roll over.

Example:

true

billing_item_ids
string[]
required

IDs of the products charged on this plan's invoices, in creation order. Read-only; amounts are defined by the corresponding price configurations.

Example:
price_configuration_ids
string[]
required

IDs of the price configurations matching billing_item_ids. Read-only.

Example:
using_policy_count
number
required

Number of customer policy scopes referencing this resource.

Example:

1

is_default
boolean
required

Whether this is the default plan or shared customer scope.

Example:

false